const useExcel = (selectKey: React.Key[], companyList: CM.CompanyShow[]) => {
  /** 表头 */
  const header = [
    'ID', '企业名称', '企业类型',
    '医疗领域', '主营业务', '组织机构代码',
    '地址', '成立时间', '企业简介'
  ];
  const excelData = [];
  excelData.push(header);
  selectKey.forEach(selectId => {
    const selectCompanyItem = companyList.find(companyItem => companyItem.id === selectId);
    if (selectCompanyItem) {
      const {
        id, name, type,
        medicalField, mainBusiness, companyNum,
        address, createDate, description
      } = selectCompanyItem;
      if (selectCompanyItem) {
        excelData.push([
          id, name, type,
          medicalField, mainBusiness, companyNum,
          address, createDate, description
        ]);
      }
    }
  });

  return excelData;

};

export default useExcel;
